#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <myimageprovider.h>
#include <QQuickView>
QQuickView *viewer;
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QQmlApplicationEngine engine;
    MyImageProvider *imageProvider = new MyImageProvider(QQuickImageProvider::Pixmap,0);
    engine.addImageProvider("images", imageProvider);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    return app.exec();
}
//#include "myimageprovider.h"

//int main(int argc, char *argv[])
//{
//    QGuiApplication app(argc, argv);

//    QQuickView view;
//    QQmlEngine *engine = view.engine();
//    MyImageProvider *imageProvider = new MyImageProvider(QQmlImageProviderBase::Image);
//    engine->addImageProvider("myprovider", imageProvider );
//    view.setSource(QUrl(QStringLiteral("qrc:///Main.qml")));
//    view.setResizeMode(QQuickView::SizeRootObjectToView);
//    view.show();
//    return app.exec();
//}
